import { defineUserConfig } from 'vuepress'
import { viteBundler } from '@vuepress/bundler-vite'
import AutoImport from "unplugin-auto-import/vite"
import theme from "./theme";
import { VuepressPluginImportDemoBlock } from './plugin/node/index'
import registerComponents from '@vuepress/plugin-register-components'
import {resolve} from 'path'


export default defineUserConfig({
  theme: theme,

  plugins: [
    registerComponents({
      componentsDir: resolve(__dirname,'../demoCode')
    }),
    VuepressPluginImportDemoBlock({
      componentsDir: resolve(__dirname,'../demoCode')
    }),
  ],
  bundler: viteBundler({
    viteOptions: {
      // resolve: {
      //   alias: {
      //   }
      // },
      plugins: [
        AutoImport({
          imports: ["vue"],
          dts: false,
          eslintrc: {
            enabled: false // Default `false`
          }
        })
      ]
    }
  })
})